#
# This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

project(ACE VERSION 6.5.5)

set(ACE_SOURCES
  ace/ACE.cpp
  ace/ACE_crc32.cpp
  ace/ACE_crc_ccitt.cpp
  ace/ATM_Acceptor.cpp
  ace/ATM_Addr.cpp
  ace/ATM_Connector.cpp
  ace/ATM_Params.cpp
  ace/ATM_QoS.cpp
  ace/ATM_Stream.cpp
  ace/Activation_Queue.cpp
  ace/Active_Map_Manager.cpp
  ace/Addr.cpp
  ace/Argv_Type_Converter.cpp
  ace/Assert.cpp
  ace/Asynch_IO.cpp
  ace/Asynch_IO_Impl.cpp
  ace/Asynch_Pseudo_Task.cpp
  ace/Atomic_Op.cpp
  ace/Barrier.cpp
  ace/Base_Thread_Adapter.cpp
  ace/Based_Pointer_Repository.cpp
  ace/Basic_Stats.cpp
  ace/Basic_Types.cpp
  ace/CDR_Base.cpp
  ace/CDR_Size.cpp
  ace/CDR_Stream.cpp
  ace/Capabilities.cpp
  ace/Cleanup.cpp
  ace/Codecs.cpp
  ace/Codeset_IBM1047.cpp
  ace/Codeset_Registry.cpp
  ace/Codeset_Registry_db.cpp
  ace/Condition_Attributes.cpp
  ace/Condition_Recursive_Thread_Mutex.cpp
  ace/Condition_Thread_Mutex.cpp
  ace/Configuration.cpp
  ace/Configuration_Import_Export.cpp
  ace/Connection_Recycling_Strategy.cpp
  ace/Containers.cpp
  ace/Copy_Disabled.cpp
  ace/DEV.cpp
  ace/DEV_Addr.cpp
  ace/DEV_Connector.cpp
  ace/DEV_IO.cpp
  ace/DLL.cpp
  ace/DLL_Manager.cpp
  ace/Date_Time.cpp
  ace/Dev_Poll_Reactor.cpp
  ace/Dirent.cpp
  ace/Dirent_Selector.cpp
  ace/Dump.cpp
  ace/Dynamic.cpp
  ace/Dynamic_Message_Strategy.cpp
  ace/Dynamic_Service_Base.cpp
  ace/Dynamic_Service_Dependency.cpp
  ace/Encoding_Converter.cpp
  ace/Encoding_Converter_Factory.cpp
  ace/Event_Base.cpp
  ace/Event_Handler.cpp
  ace/Event_Handler_Handle_Timeout_Upcall.cpp
  ace/FIFO.cpp
  ace/FIFO_Recv.cpp
  ace/FIFO_Recv_Msg.cpp
  ace/FIFO_Send.cpp
  ace/FIFO_Send_Msg.cpp
  ace/FILE.cpp
  ace/FILE_Addr.cpp
  ace/FILE_Connector.cpp
  ace/FILE_IO.cpp
  ace/File_Lock.cpp
  ace/Filecache.cpp
  ace/Flag_Manip.cpp
  ace/Framework_Component.cpp
  ace/Functor.cpp
  ace/Functor_String.cpp
  ace/Get_Opt.cpp
  ace/Handle_Ops.cpp
  ace/Handle_Set.cpp
  ace/Hashable.cpp
  ace/High_Res_Timer.cpp
  ace/ICMP_Socket.cpp
  ace/INET_Addr.cpp
  ace/IOStream.cpp
  ace/IO_Cntl_Msg.cpp
  ace/IO_SAP.cpp
  ace/IPC_SAP.cpp
  ace/Init_ACE.cpp
  ace/LSOCK.cpp
  ace/LSOCK_Acceptor.cpp
  ace/LSOCK_CODgram.cpp
  ace/LSOCK_Connector.cpp
  ace/LSOCK_Dgram.cpp
  ace/LSOCK_Stream.cpp
  ace/Lib_Find.cpp
  ace/Local_Memory_Pool.cpp
  ace/Local_Name_Space.cpp
  ace/Local_Tokens.cpp
  ace/Lock.cpp
  ace/Log_Category.cpp
  ace/Log_Msg.cpp
  ace/Log_Msg_Android_Logcat.cpp
  ace/Log_Msg_Backend.cpp
  ace/Log_Msg_Callback.cpp
  ace/Log_Msg_IPC.cpp
  ace/Log_Msg_NT_Event_Log.cpp
  ace/Log_Msg_UNIX_Syslog.cpp
  ace/Log_Record.cpp
  ace/Logging_Strategy.cpp
  ace/MEM_Acceptor.cpp
  ace/MEM_Addr.cpp
  ace/MEM_Connector.cpp
  ace/MEM_IO.cpp
  ace/MEM_SAP.cpp
  ace/MEM_Stream.cpp
  ace/MMAP_Memory_Pool.cpp
  ace/Malloc.cpp
  ace/Malloc_Allocator.cpp
  ace/Mem_Map.cpp
  ace/Message_Block.cpp
  ace/Message_Queue.cpp
  ace/Message_Queue_NT.cpp
  ace/Message_Queue_Vx.cpp
  ace/Method_Request.cpp
  ace/Monitor_Admin.cpp
  ace/Monitor_Admin_Manager.cpp
  ace/Monitor_Base.cpp
  ace/Monitor_Control_Action.cpp
  ace/Monitor_Control_Types.cpp
  ace/Monitor_Point_Registry.cpp
  ace/Monitor_Size.cpp
  ace/Monotonic_Time_Policy.cpp
  ace/Msg_WFMO_Reactor.cpp
  ace/Multihomed_INET_Addr.cpp
  ace/Mutex.cpp
  ace/NT_Service.cpp
  ace/Name_Proxy.cpp
  ace/Name_Request_Reply.cpp
  ace/Name_Space.cpp
  ace/Naming_Context.cpp
  ace/Netlink_Addr.cpp
  ace/Notification_Queue.cpp
  ace/Notification_Strategy.cpp
  ace/Null_Mutex.cpp
  ace/OS_Errno.cpp
  ace/OS_Log_Msg_Attributes.cpp
  ace/OS_NS_Thread.cpp
  ace/OS_NS_arpa_inet.cpp
  ace/OS_NS_ctype.cpp
  ace/OS_NS_devctl.cpp
  ace/OS_NS_dirent.cpp
  ace/OS_NS_dlfcn.cpp
  ace/OS_NS_errno.cpp
  ace/OS_NS_fcntl.cpp
  ace/OS_NS_math.cpp
  ace/OS_NS_netdb.cpp
  ace/OS_NS_poll.cpp
  ace/OS_NS_pwd.cpp
  ace/OS_NS_regex.cpp
  ace/OS_NS_signal.cpp
  ace/OS_NS_stdio.cpp
  ace/OS_NS_stdlib.cpp
  ace/OS_NS_string.cpp
  ace/OS_NS_strings.cpp
  ace/OS_NS_stropts.cpp
  ace/OS_NS_sys_mman.cpp
  ace/OS_NS_sys_msg.cpp
  ace/OS_NS_sys_resource.cpp
  ace/OS_NS_sys_select.cpp
  ace/OS_NS_sys_sendfile.cpp
  ace/OS_NS_sys_shm.cpp
  ace/OS_NS_sys_socket.cpp
  ace/OS_NS_sys_stat.cpp
  ace/OS_NS_sys_time.cpp
  ace/OS_NS_sys_uio.cpp
  ace/OS_NS_sys_utsname.cpp
  ace/OS_NS_sys_wait.cpp
  ace/OS_NS_time.cpp
  ace/OS_NS_unistd.cpp
  ace/OS_NS_wchar.cpp
  ace/OS_NS_wctype.cpp
  ace/OS_QoS.cpp
  ace/OS_TLI.cpp
  ace/OS_Thread_Adapter.cpp
  ace/OS_main.cpp
  ace/Obchunk.cpp
  ace/Object_Manager.cpp
  ace/Object_Manager_Base.cpp
  ace/Obstack.cpp
  ace/PI_Malloc.cpp
  ace/POSIX_Asynch_IO.cpp
  ace/POSIX_CB_Proactor.cpp
  ace/POSIX_Proactor.cpp
  ace/Pagefile_Memory_Pool.cpp
  ace/Parse_Node.cpp
  ace/Ping_Socket.cpp
  ace/Pipe.cpp
  ace/Priority_Reactor.cpp
  ace/Proactor.cpp
  ace/Proactor_Impl.cpp
  ace/Process.cpp
  ace/Process_Manager.cpp
  ace/Process_Mutex.cpp
  ace/Process_Semaphore.cpp
  ace/Profile_Timer.cpp
  ace/RW_Mutex.cpp
  ace/RW_Process_Mutex.cpp
  ace/RW_Thread_Mutex.cpp
  ace/Reactor.cpp
  ace/Reactor_Impl.cpp
  ace/Reactor_Notification_Strategy.cpp
  ace/Reactor_Timer_Interface.cpp
  ace/Read_Buffer.cpp
  ace/Recursive_Thread_Mutex.cpp
  ace/Recyclable.cpp
  ace/Registry.cpp
  ace/Registry_Name_Space.cpp
  ace/Remote_Name_Space.cpp
  ace/Remote_Tokens.cpp
  ace/SOCK.cpp
  ace/SOCK_Acceptor.cpp
  ace/SOCK_CODgram.cpp
  ace/SOCK_Connector.cpp
  ace/SOCK_Dgram.cpp
  ace/SOCK_Dgram_Bcast.cpp
  ace/SOCK_Dgram_Mcast.cpp
  ace/SOCK_IO.cpp
  ace/SOCK_Netlink.cpp
  ace/SOCK_SEQPACK_Acceptor.cpp
  ace/SOCK_SEQPACK_Association.cpp
  ace/SOCK_SEQPACK_Connector.cpp
  ace/SOCK_Stream.cpp
  ace/SPIPE.cpp
  ace/SPIPE_Acceptor.cpp
  ace/SPIPE_Addr.cpp
  ace/SPIPE_Connector.cpp
  ace/SPIPE_Stream.cpp
  ace/SString.cpp
  ace/SUN_Proactor.cpp
  ace/SV_Message.cpp
  ace/SV_Message_Queue.cpp
  ace/SV_Semaphore_Complex.cpp
  ace/SV_Semaphore_Simple.cpp
  ace/SV_Shared_Memory.cpp
  ace/Sample_History.cpp
  ace/Sbrk_Memory_Pool.cpp
  ace/Sched_Params.cpp
  ace/Select_Reactor_Base.cpp
  ace/Semaphore.cpp
  ace/Service_Config.cpp
  ace/Service_Gestalt.cpp
  ace/Service_Manager.cpp
  ace/Service_Object.cpp
  ace/Service_Repository.cpp
  ace/Service_Types.cpp
  ace/Shared_Memory.cpp
  ace/Shared_Memory_MM.cpp
  ace/Shared_Memory_Pool.cpp
  ace/Shared_Memory_SV.cpp
  ace/Shared_Object.cpp
  ace/Sig_Adapter.cpp
  ace/Sig_Handler.cpp
  ace/Signal.cpp
  ace/Sock_Connect.cpp
  ace/Stack_Trace.cpp
  ace/Stats.cpp
  ace/String_Base_Const.cpp
  ace/Svc_Conf_Lexer.cpp
  ace/Svc_Conf_y.cpp
  ace/Synch_Options.cpp
  ace/System_Time.cpp
  ace/TLI.cpp
  ace/TLI_Acceptor.cpp
  ace/TLI_Connector.cpp
  ace/TLI_Stream.cpp
  ace/TP_Reactor.cpp
  ace/TSS_Adapter.cpp
  ace/TTY_IO.cpp
  ace/Task.cpp
  ace/Thread.cpp
  ace/Thread_Adapter.cpp
  ace/Thread_Control.cpp
  ace/Thread_Exit.cpp
  ace/Thread_Hook.cpp
  ace/Thread_Manager.cpp
  ace/Thread_Mutex.cpp
  ace/Thread_Semaphore.cpp
  ace/Throughput_Stats.cpp
  ace/Time_Policy.cpp
  ace/Time_Value.cpp
  ace/Timeprobe.cpp
  ace/Token.cpp
  ace/Token_Collection.cpp
  ace/Token_Invariants.cpp
  ace/Token_Manager.cpp
  ace/Token_Request_Reply.cpp
  ace/Trace.cpp
  ace/UNIX_Addr.cpp
  ace/UPIPE_Acceptor.cpp
  ace/UPIPE_Connector.cpp
  ace/UPIPE_Stream.cpp
  ace/UTF16_Encoding_Converter.cpp
  ace/UTF32_Encoding_Converter.cpp
  ace/UTF8_Encoding_Converter.cpp
  ace/UUID.cpp
  ace/WFMO_Reactor.cpp
  ace/WIN32_Asynch_IO.cpp
  ace/WIN32_Proactor.cpp
  ace/XML_Svc_Conf.cpp
  ace/XTI_ATM_Mcast.cpp
  ace/ace_wchar.cpp
  $<$<BOOL:${PCH}>:
    pch.cpp
    pch.h
  >
)

add_library(ace STATIC
    ${ACE_SOURCES}
)

target_include_directories(ace
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
)

target_compile_definitions(ace
    PUBLIC
        ACE_AS_STATIC_LIBS
        $<$<PLATFORM_ID:FreeBSD>:_WANT_SEMUN>
)

if(PCH)
    add_cxx_pch(ace ${CMAKE_CURRENT_SOURCE_DIR}/pch.h ${CMAKE_CURRENT_SOURCE_DIR}/pch.cpp)
endif()